from django.db import models
from django.contrib.auth.models import AbstractUser, Group, Permission
from utils.base_model import BaseModel


class User(AbstractUser, BaseModel):
    # username = models.CharField(
    #     "用户名",
    #     max_length=150,
    #     help_text=(
    #         "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."
    #     ),
    #     error_messages={
    #         "unique": ("A user with that username already exists."),
    #     },
    # )
    email = models.EmailField(verbose_name="邮箱")
    verbose_name = [
        (0, '未知'),
        (1, '女'),
        (2, '男'),
    ]
    gender = models.SmallIntegerField(verbose_name='性别', choices=verbose_name, default=0)
    # age = models.PositiveSmallIntegerField(verbose_name='年龄', blank=True)

    def __str__(self):
        return self.username

    # def set_password(self, raw_password):
    #     ...
    #
    # def save(self, *args, **kwargs):
    #     ...


